package net.hashcoding.cookbook.controller;

import net.hashcoding.cookbook.core.HttpMethod;
import net.hashcoding.cookbook.core.controller.BaseController;
import net.hashcoding.cookbook.core.controller.Parameter;
import net.hashcoding.cookbook.core.controller.TargetURI;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;

/**
 * Created by Administrator on 2017/6/24.
 */
public class TestController extends BaseController {

    @Override
    public void get(HttpServletRequest request, HttpServletResponse response) {
        HashMap<String, Object> env = getEnvironment();
        response.setContentType("text/html");
        PrintWriter writer;
        try {
            writer = response.getWriter();
        } catch (IOException e) {
            e.printStackTrace();
            return;
        }
        writer.println("<h3>" + "hello" + "</h3>");
    }

    @TargetURI(name = "", method = {HttpMethod.GET})
    protected void test(@Parameter("name") String name) {

    }
}
